import { useState } from "react";

export const useSequenceColor = (colors) => {
    const lenColors = colors.length; 
    const [count,setCount] = useState(0);
    const [color,setColor] = useState(colors[count]);
    const nextColor = () => {
        if(count == lenColors-1){
            setCount(0)
        }else{
            setCount(count+1)
        }
        setColor(colors[count]);
    }
    return [count,color,nextColor]
}